/**
 * @Author DengJia
 * @Date 2021/8/23 22:11
 * @Description
 */

public class TestFinally1 {
    private Integer id;
    private final Stu stu;

    public TestFinally1() {
        this.stu = new Stu("默认");
    }

    public TestFinally1(Integer id, Stu stu) {
        this.id = id;
        this.stu = stu;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Stu getStu() {
        return stu;
    }

    @Override
    public String toString() {
        return "TestFinally1{" +
                "id=" + id +
                ", stu=" + stu +
                '}';
    }

    public static void main(String[] args) {
        TestFinally1 finally1 = new TestFinally1();
        finally1.setId(666);
        Stu stu = finally1.getStu();
        stu = new Stu();
        System.out.println("finally1 = " + finally1);
    }
}

